<template>
  <div class="shopping">
    <div class="shop  fl" v-for="item in shops" :key='item.id'  @click="goshopdesc(item.id,item)">
      <img :src="item.src" alt="" class="shop-img">
      <p>{{item.text}}</p>
      <!-- <div class="mes">
        <div class="money fl"></div>
        <div class="look fr"></div>
      </div> -->
    </div>
  
</div>
</template>

<script>
  import request from '@/request/request.js'
  export default {
    data(){
      return{
        shops:[]
      }
    },
      methods:{
      goshopdesc(id,item){
        this.$router.push({name:"shopdesc",params:{id:id,item:item}})//history模式跳转可以通过back返回
      }
    },
    created() {
      request({
        url:"http://localhost:8080/static/data/lists.json"
      }).then((res)=>this.shops=res.data)
    },
  }
</script>

<style>
.shopping{
    width:100%;
    /* display:flex; */
}
.shop  img{
   width:100%;
}
.shop{
  width:50%;
  box-sizing:border-box;
}
.shopping   .fl{
    width:47%;
    display: inline-table;
  /* float:left; */
} 
</style>
